#include <head.h>

int main(int argc, char const *argv[])
{

    int shmid;

    key_t key = ftok("./key",'A');

    //创建共享内存
    shmid = shmget(key,4096,IPC_CREAT|0666);
    if(shmid==-1)
    {
        printf("共享内存创建失败\n");
        return 0;
    }    

    printf("共享内存创建成功 id = %d\n",shmid);

    return 0;
}
